package com.ocom.webapi.controller;

import com.ocom.common.constant.WebApiServiceUrl;
import com.ocom.common.request.web.ConsumeLimitConfigOnShowRequest;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.pay.ConsumeLimitVo;
import com.ocom.webapi.feign.PayConfigClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: TODO
 * @Author: 朱晖
 * @Date: 2022/7/14
 **/
@PreAuthorize("@pms.hasRole('ROLE_WEB')" )
@RestController
public class ConsumeLimitConfigController {

	@Autowired
	PayConfigClientService payConfigClientService;

	@PostMapping(WebApiServiceUrl.URL_ConsumeLimitConfigOnShow)
	public Result onShow(@RequestBody ConsumeLimitConfigOnShowRequest request){
		return payConfigClientService.getConsumeLimitConfig(request);
	}

	@PostMapping(WebApiServiceUrl.URL_ConsumeLimitConfigOnUpdate)
	public Result update(@RequestBody ConsumeLimitVo consumeLimitVo){
		return payConfigClientService.setConsumeLimitConfig(consumeLimitVo);
	}


}
